home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
ProcessWatcher 3.0 ト.sit
/
ProcessWatcher 3.0 ƒ
/
pwsuite.h
< prev
next >
Wrap
Text File
|
1996-04-28
|
5KB
|
187 lines
// pwsuite.h - ProcessWatcher AppleEvents Suite
// (c) H. Marty 1995
#ifndef _H_pwsuite
#define _H_pwsuite
#ifndef rez
#include <Processes.h>
//*******************************************************************
struct ProcessListRec {
ProcessSerialNumber psn;
Str31 name;
};
#endif /* rez */
//*******************************************************************
// PW signature
#define kPWSignature 'YgzP'
#define kPWSuite kPWSignature
// Event Class
#define kAEPWEventClass kPWSignature
// Events
#define kAEPWGetProcessList 'glis'
#define kAEPWListProcesses 'lpro'
#define kAEPWGetProcessInfo 'ginf'
#define kAEPWKill 'kill'
#define kAEPWBringToFront 'fron'
#define kAEPWConnect 'conp'
#define keyPWTargetProcess 'prtg' // typeProcessSerialNumber
#define typePWProcessList 'plis'
/*
typePWProcessList defines an array of ProcessListRec :
typedef struct {
ProcessSerialNumber psn; // Process serial number
Str31 name; // Pascal string (process name)
} ProcessListRec;
The number of processes is given by deviding the data size by
sizeof(ProcessListRec).
Be very careful that desk accessories names begin with the NULL
character, so there may be some problems converting process names
to C strings.
*/
#define typePWProcessInfo 'pinf'
/*
typePWProcessInfo defines a ProcessInfoRec record
size: sizeof(ProcessInfoRec)
"bug": the processName and processAppSpec field are set to nil,
but you should already know the name from the get process list
Apple Event.
Note: the launch date of the ProcessInfoRec is in fact the real date
and time when the process was launched, and not the number of ticks elapsed
between boot and launch.
*/
/*
********************************************************************************
Get processes list
==================
Event Class kAEPWEventClass
Event ID kAEPWGetProcessList
Parameters
----------
None
Reply parameters
----------------
keyAEResult An array of structures giving process serial numbers
and name of all processes running on the machine.
Descriptor type typePWProcessList
Required
Size multiple of sizeof(ProcessListRec)
keyErrorNumber The result code for the event
Descriptor type typeLongInteger
Optional (the abscence of parameter means no error happened)
Size 4 bytes
********************************************************************************
List processes
==============
Event Class kAEPWEventClass
Event ID kAEPWListProcesses
Parameters
----------
None
Reply parameters
----------------
keyAEResult An list of processes names.
Descriptor type typeList
Required
keyErrorNumber The result code for the event
Descriptor type typeLongInteger
Optional (the abscence of parameter means no error happened)
Size 4 bytes
********************************************************************************
Get process info
================
Event Class kAEPWEventClass
Event ID kAEPWGetProcessInfo
Parameters
----------
keyDirectObject The process for which information is desired.
Descriptor type typeProcessSerialNumber
Required
Size sizeof(ProcessSerialNumber)
Reply parameters
----------------
keyAEResult A ProcessInfoRec giving the process information.
Descriptor type typePWProcessInfo
Required
Size sizeof(ProcessInfoRec)
keyErrorNumber The result code for the event
Descriptor type typeLongInteger
Optional (the abscence of parameter means no error happened)
Size 4 bytes
********************************************************************************
Kill process
============
Event Class kAEPWEventClass
Event ID kAEPWKill
Parameters
----------
keyDirectObject The process to be killed.
Descriptor type typeProcessSerialNumber
Required
Size sizeof(ProcessSerialNumber)
Reply parameters
----------------
keyErrorNumber The result code for the event
Descriptor type typeLongInteger
Optional (the abscence of parameter means no error happened)
Size 4 bytes
********************************************************************************
Bring process to front
======================
Event Class kAEPWEventClass
Event ID kAEPWBringToFront
Parameters
----------
keyDirectObject The process to be brought to front.
Descriptor type typeProcessSerialNumber
Required
Size sizeof(ProcessSerialNumber)
Reply parameters
----------------
keyErrorNumber The result code for the event
Descriptor type typeLongInteger
Optional (the abscence of parameter means no error happened)
Size 4 bytes
*/
#endif